<?php
 require "../document/class_corpus.php";
 require "../document/class_document.php";
 require "../document/class_document_xml.php";

 require "../files/tool_files_dirs.php";
 require "../misc/class_tag.php";

 require "../tree/class_tree.php";
 require "../tree/class_tree_xhtml.php";
 require "../tree/class_structure.php";
 require "../tree/tool_tree.php";

 require "../array/tool_array.php";

 require "./tool_string.php";
 require "./class_segment.php";


$str="abc def ghi";
$mot1=new mot($str,0,3);
$mot2=new mot($str,5,3);
$mot3=new mot($str,9,3);
$chunk=new chunk(array($mot1,$mot2));

echo $chunk;

die();

 $corpus=tool_corpus::get_corpus_regexp("../xml/europa/","4.fr.xml");
 //$corpus=tool_corpus::get_corpus_regexp("../xml/test/",".fr.xml");
 $array_doc=$corpus->__get_array_doc();
 $document=$array_doc[0];
// print_r($document);
// die();
 $structure=$document->__get_structure();
 $signature=$structure->__get_signature();
 tool_tree::cleanstructure(&$signature);
 $signature->__recalc_idn();

 //echo tool_tree::structure2texte($signature);
 $test=new RecursiveIteratorIterator($signature,RecursiveIteratorIterator::SELF_FIRST);

 $factory_mot=new factory_mot();

 $time_start = microtime(true);
 foreach($test as $bloc_xhtml){
    $texte=tool_tree::tree_xhtml2texte($bloc_xhtml->__get_value());
    $id=$factory_mot->get_all_mots($texte);
//    $factory_mot->get_array_words($texte);
//    echo "\r$id";
   //print_r(tool_tree::tree_xhtml2texte($bloc_xhtml));
   //echo $bloc_xhtml;
 }

$time_end = microtime(true);
$time=$time_end-$time_start;
echo "time=$time\n";

//tool_factory_mot::factory2dictionnairetexte($factory_mot);
 tool_factory_mot::factory2texte($factory_mot); 
// echo tool_tree::structure2texte($signature);
// print_r(count($array_doc));
die();

foreach($array_doc as $doc){
 $structure=$doc->__get_structure();
 $signature=$structure->__get_signature();
 //echo get_class($structure);
 //print_r($signature);
 echo tool_tree::structure2texte($signature); 
}



die();
 $array_ids_europa=tool_corpus::europa_get_all_ids("../xml/europa/");
 $array_corpus_groupe=array();

 $time_start = microtime(true);
 foreach($array_ids_europa as $id_europa){
  $corpus=tool_corpus::get_corpus_regexp("../xml/europa/",$id_europa);
  $array_corpus_groupe[$id_europa]=array();
  //echo "$id_europa\n";
  foreach($corpus->__get_array_doc() as $document){
    $structure=$document->__get_structure();
    $signature=$structure->__get_signature();
    tool_tree::cleanstructure($signature);
    $signature->__recalc_idn();
    echo tool_tree::structure2texte($signature);
  }
  die();
 }
 die();


?>
